import Vue from 'vue'
import Router from 'vue-router'
import Main from '../components/Main.vue'
import Login from '../components/Login.vue'
import Shopping from '../components/Shopping.vue'
import Search from '../components/Search.vue'
import Home from '../components/pages/Home.vue'
import Category from '../components/pages/Category.vue'
import Classify from '../components/pages/Classify.vue'
import Vip from '../components/pages/Vip.vue'
import Detail from '../view/Detail.vue'
import Searchshops from '../components/pages/Searchshops.vue'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      // name: 'Main',
      component: Main,
      children: [{
          path: '/',
          redirect: 'home'
        },
        {
          path: 'home',
          name: 'Home',
          component: Home
        },
        {
          path:'/vip',
          name:'Vip',
          component:Vip
        },
        {
          path: 'category/:id',
          name: 'Category',
          component: Category
        },{
          path:"searchshops",
          name:'Searchshops',
          component:Searchshops
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/shopping',
      name: 'Shopping',
      component: Shopping
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/classify',
      name: 'Classify',
      component: Classify
    },
    {
      path: '/detail/:id',
      name: 'Detail',
      component: Detail
    },
  ]
})
